<template>
  <div class="p-lr-15">
    <a-form :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
      <a-form-item required label="页面类型">
        <a-select
          v-model:value="data.pageType"
          @change="pageTypeChange"
          placeholder="请选择"
        >
          <a-select-option :value="0">公司主页模板</a-select-option>
          <a-select-option :value="2">个人主页模板</a-select-option>
          <a-select-option :value="1">部门主页</a-select-option>
          <a-select-option :value="3">业务模块</a-select-option>
        </a-select>
      </a-form-item>
      <a-form-item
        label="实体Id"
        v-show="data.pageType === 1 || data.pageType === 3"
      >
        <a-select v-model:value="data.emptyId" placeholder="请选择"></a-select>
      </a-form-item>
      <a-form-item required label="名称">
        <a-input v-model:value="data.name" placeholder="请输入名称"></a-input>
      </a-form-item>

      <a-form-item label="备注">
        <a-textarea
          v-model:value="data.note"
          placeholder="请输入备注"
          :rows="4"
        />
      </a-form-item>
    </a-form>
  </div>
</template>

<script>
  export default {
    // eslint-disable-next-line vue/require-prop-types
    props: ['data'],
    data() {
      return {
        linkDbData: [],
        linkTableData: [],
        linkFiledData: [],
      }
    },
    created() {
      console.log('页面属性', this.data)
    },

    methods: {
      pageTypeChange(e) {
        if (e === 0 || e === 2) {
          this.$emit('reload', e)
        }
      },
    },
  }
</script>
